package cn.org.eshow.webapp.action.response;

import cn.org.eshow.model.Blog;

import java.util.Date;

/**
 * 博文返回对象
 */
public class BlogResponse {

    public Integer id;
    public Date addTime;// 添加时间
    public Date updateTime;// 更新时间
    public String title;// 标题
    public String content;// 正文
    public String category;// 分类(家装背景墙   家装儿童房)
    public String img;//图片
    public Integer count;// 浏览次数
    public ProductResponse product;//商品返回对象


    public BlogResponse(Blog blog) {
        this.id = blog.getId();
        this.addTime = blog.getAddTime();
        this.updateTime = blog.getUpdateTime();
        this.title = blog.getTitle();
        this.content = blog.getContent();
        this.category = blog.getCategory();
        this.img = blog.getImg();
        if (blog.getProduct() != null) {
            this.product = new ProductResponse(blog.getProduct());
        }
        this.count = blog.getCount();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }


    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public ProductResponse getProduct() {
        return product;
    }

    public void setProduct(ProductResponse product) {
        this.product = product;
    }
}
